﻿using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Wozuji.Logic.Users;

public partial class _Default : Wozuji.Logic.PageLogin
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Users ur = new Users();
        Session.Remove("userid");
        result.Text = "";
        string userName, passWord;
        userName = username.Text.ToString();
        passWord = password.Text.ToString();
        
        bool ischecked;
        ischecked = issave.Checked;



        


            //判断用户的输入
            if (userName.Equals("") || passWord.Equals(""))
            {
                result.Text = "用户名或密码不能为空!";
            }
            //输入无问题,开始登录
            else
            {

                if (ur.userLogin(userName, passWord, ischecked))
                {
                    Response.Redirect("/user/default.aspx");
                    

                }
                else
                {
                    result.Text = "用户名或密码错误!";
                }
            }
        //Users=null;
        }

        

        
    }





